package com.egdd.video.service.iml;

import com.egdd.video.mapper.AlbumsMapper;
import com.egdd.video.pojo.Albums;
import com.egdd.video.service.IAlbumsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AlbumsServiceImpl implements IAlbumsService {

    @Autowired(required = false)
    private AlbumsMapper albumsMapper;

    @Override
    public List<Albums> getAlbumsByCategoryId(Integer categoryId) {
        return albumsMapper.getAlbumsByCategoryId(categoryId);
    }

    @Override
    public List<Albums> getAllAlbums() {
        return albumsMapper.getAll();
    }

    @Override
    public int addAlbums(Albums albums) {
        return albumsMapper.insert(albums);
    }

    @Override
    public int delAlbumsById(int id) {
        return albumsMapper.deleteByPrimaryKey(id);
    }
}
